package org.westos.demo2;

import java.io.*;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("192.168.2.126", 9999);
        FileInputStream in = new FileInputStream(new File("F:\\桌面\\readme.txt"));
        OutputStream out = socket.getOutputStream();
        int len=0;
        byte[] bytes = new byte[1024];
        while ((len=in.read(bytes))!=-1){
            out.write(bytes,0,len);
        }
        socket.close();
        in.close();
        out.close();


    }
}
